home *** CD-ROM | disk | FTP | other *** search
- global xWindow, gDataFile, gMiaWAvailable
-
- on ohBoy
- sound stop 1
- sound stop 2
- loseMiaW()
- showMiaW()
- if objectp(xWindow) then
- go("MiaW")
- tell xWindow
- showImage()
- end tell
- pause()
- else
- go("File not found. Oh, well.")
- put "File not found. Oh, well."
- end if
- end
-
- on showMiaW
- if objectp(xWindow) then
- open(xWindow)
- else
- readDataFile("Toolbox.DIR")
- if gMiaWAvailable = 1 then
- set xWindow to window "Tools"
- set the rect of xWindow to rect(0, 431, 640, 456)
- set the fileName of xWindow to "Toolbox.DIR"
- set the titleVisible of xWindow to 0
- set the modal of xWindow to 0
- open(xWindow)
- else
- go("File not found. Oh, well.")
- put "File not found. Oh, well."
- end if
- end if
- end
-
- on hideMiaW
- if objectp(xWindow) then
- close(xWindow)
- else
- do("nothing")
- end if
- end
-
- on loseMiaW
- if objectp(xWindow) then
- forget(xWindow)
- end if
- end
-
- on getCenteredRect theRectWidth, theRectHeight
- set theRectLeft to ((the stageLeft + the stageRight) / 2) - (theRectWidth / 2)
- set theRectTop to ((the stageTop + the stageBottom) / 2) - (theRectHeight / 2)
- return rect(theRectLeft, theRectTop, theRectLeft + theRectWidth, theRectTop + theRectHeight)
- end
-
- on replyYes
- hideMiaW()
- continue()
- go(marker(1))
- end
-
- on replyNo
- hideMiaW()
- continue()
- go(marker(1))
- end
-
- on MiawYES whichSprite
- if legalButton(whichSprite) = 1 then
- go(1)
- tell the stage
- replyYes()
- end tell
- else
- go(the frame)
- end if
- end
-
- on MiawNO whichSprite
- if legalButton(whichSprite) = 1 then
- go(1)
- tell the stage
- replyNo()
- end tell
- else
- go(the frame)
- end if
- end
-
- on readDataFile whichFile
- set gMiaWAvailable to 0
- set gDataFile to FileIO(mnew, "read", the pathName & whichFile)
- if objectp(gDataFile) = 0 then
- set gMiaWAvailable to 0
- else
- set gMiaWAvailable to 1
- end if
- end
-